package com.cloud.stream2.partition;

import org.springframework.cloud.stream.binder.PartitionSelectorStrategy;

/**
 * @author shengtao
 * @Description:
 * @date 2019/06/04 16:01
 */
public class CustomPartitionSelector implements PartitionSelectorStrategy {
    @Override
    public int selectPartition(Object key, int partitionCount) {
        System.out.println("消息载荷的key：" + key + " partitionCount：" + partitionCount);
        String keyWord = key.toString();
        long id = Long.valueOf(keyWord);
        return 0;
    }
}
